package com.woniu.service.sportsHealth.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import com.woniu.mapper.sportsHealth.StepMapper;
import com.woniu.model.sportsHealth.entity.Step;
import com.woniu.model.sportsHealth.model.dto.StepDto;
import com.woniu.model.sportsHealth.model.vo.StepVo;
import com.woniu.service.sportsHealth.IStepService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 步数表 服务实现类
 * </p>
 *
 * @author Jet
 * @since 2023-10-23
 */
@Service
public class StepServiceImpl extends ServiceImpl<StepMapper, Step> implements IStepService {

    @Autowired
    StepMapper stepMapper;
    @Override
    public PageInfo<StepDto> findAll(Map<String, Object> param, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);

        List<StepDto> stepList = stepMapper.findAll(param);
        PageInfo<StepDto> stepVoPageInfo = new PageInfo<>(stepList);


        return stepVoPageInfo;
    }

    @Override
    public List<StepVo> findAllExport() {
        List<StepVo> stepDtoList = stepMapper.findAllExport();
        return stepDtoList;
    }
}
